#########################################################################
##
## This file is part of the SAMRAI distribution.  For full copyright 
## information, see COPYRIGHT and LICENSE. 
##
## Copyright:     (c) 1997-2019 Lawrence Livermore National Security, LLC
## Description:   makefile for fortran files for SAMRAI Convection-Diffusion
##                ODE sample application
##
#########################################################################

SAMRAI        = @top_srcdir@
SRCDIR        = @srcdir@
SUBDIR        = source/test/applications/ConvDiff/fortran
VPATH         = @srcdir@
OBJECT        = ../../../../..

default: main

include $(OBJECT)/config/Makefile.config

OBJS= 	compute_rhs2d.o init2d.o rkstep2d.o tag_cells2d.o \
	compute_rhs3d.o init3d.o rkstep3d.o tag_cells3d.o

main:	$(OBJS)

clean:
	$(CLEAN_COMMON_TEST_FILES)

include $(SRCDIR)/Makefile.depend

M4DIRS = -DFORTDIR=$(SRCDIR) $(SAMRAI_M4_FLAGS)

compute_rhs2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/compute_rhs2d.m4 > compute_rhs2d.f
	$(F77) $(FFLAGS) -c compute_rhs2d.f -o $@

init2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/init2d.m4 > init2d.f
	$(F77) $(FFLAGS) -c init2d.f -o $@

tag_cells2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/tag_cells2d.m4 > tag_cells2d.f
	$(F77) $(FFLAGS) -c tag_cells2d.f -o $@

rkstep2d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/rkstep2d.m4 > rkstep2d.f
	$(F77) $(FFLAGS) -c rkstep2d.f -o $@


compute_rhs3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/compute_rhs3d.m4 > compute_rhs3d.f
	$(F77) $(FFLAGS) -c compute_rhs3d.f -o $@

init3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/init3d.m4 > init3d.f
	$(F77) $(FFLAGS) -c init3d.f -o $@

tag_cells3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/tag_cells3d.m4 > tag_cells3d.f
	$(F77) $(FFLAGS) -c tag_cells3d.f -o $@

rkstep3d.o:
	$(M4) $(M4DIRS) $(SRCDIR)/rkstep3d.m4 > rkstep3d.f
	$(F77) $(FFLAGS) -c rkstep3d.f -o $@
